package com.controller;

import com.entity.RbacRoleMenuDTO;
import com.entity.ResponseEntity;
import com.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rbacRole")
public class RbacRoleController {
    private RbacRoleService rbacRoleService;
    @Autowired
    public void setRbacRoleService(RbacRoleService rbacRoleService) {
        this.rbacRoleService = rbacRoleService;
    }
    @GetMapping("/findAll/{currentPage}/{pageSize}")
    public ResponseEntity findAll(@PathVariable int currentPage, @PathVariable int pageSize){
        return rbacRoleService.findAll(currentPage,pageSize);
    }
    @GetMapping("/checked/{roleId}")
    public ResponseEntity checkedRole(@PathVariable int roleId){
        return rbacRoleService.checkedRole(roleId);
    }
    @PostMapping("/schangeMenus")
    public ResponseEntity changeMenus(@RequestBody RbacRoleMenuDTO rbacRoleMenuDTO){
        return rbacRoleService.changeMenus(rbacRoleMenuDTO);
    }
}
